﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

class InsertLineNumbers
{
    static void Main(string[] args)
    {
        using (StreamReader file = new StreamReader("file.docx", Encoding.GetEncoding("Windows-1251")))
        {
            using (StreamWriter output = new StreamWriter("output.docx", false, Encoding.GetEncoding("Windows-1251")))
            {

                int lineNumber = 0;
                int count = 1;
                string line = file.ReadLine();
                while (line != null)
                {
                    lineNumber++;
                    Console.WriteLine("{0} {1}", count++, line);
                    output.WriteLine("{0} {1}", count++, line);
                    line = file.ReadLine();

                }
            }
        }
    }
}
